package com.mushuilingfeng.ddd.user.domain.util;

/**
 * @author
 * @date 2024/9/29
 */
public class TelUtil {

    public static String mask(String tel) {
        if (tel == null) {
            return null;
        }
        return tel.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
    }

    public static boolean isTel(String tel) {
        return tel != null && tel.matches("^1[3-9]\\d{9}$");
    }

}
